<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/28 0028
 * Time: 20:23
 */

namespace app\storage\model;
use think\Model;

class FeedDetailModel extends Model
{
    protected $table = 'smt_feed_station_detail';
    protected $pk = 'uuid';

    /***
     * @param $condition
     * @return mixed
     * @throws \think\Exception
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * 获取料站细表信息（展示）
     */
    public function getFeedDetail($condition){
        $where = $condition['where'];
        $pageIndex = $condition['pageIndex'];
        $pageSize = $condition['pageSize'];
        $ret['total'] = $this->where($where)->count();
        $ret['row'] = $this
            ->where($where)->order('machine_id , seat_code asc')
            ->page($pageIndex,$pageSize)
            ->select();
        return $ret;
    }
}